﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using intelliPaper.DB;
using intelliPaper.DB.Util;

namespace intelliSys.Management.Automation.Profiler.LocalDBManipulation
{
    static class LocalDBManipulator
    {
        public static bool DeleteAllKnowledgePoint()
        {
            try
            {
                DBConnection dbCon = new DBConnection();
                dbCon.ExecuteSql("delete  from question_knowledgepoint");
                dbCon.ExecuteSql("delete  from paper_knowledgepoint");
                dbCon.ExecuteSql("delete  from knowledgepoint");
                return true;
            }
            catch
            {
                return false;
            }
        }
        public static bool DeleteAllPaper()
        {
            try
            {
                DBConnection dbCon = new DBConnection();
                dbCon.ExecuteSql("delete  from paper_question");
                dbCon.ExecuteSql("delete  from paper_knowledgepoint");
                dbCon.ExecuteSql("delete  from paper");
                return true;
            }
            catch
            {
                return false;
            }
        }
        public static bool DeleteAllQuestions()
        {
            try
            {
                DBConnection dbCon = new DBConnection();
                dbCon.ExecuteSql("delete  from paper_question");
                dbCon.ExecuteSql("delete  from question_answer");
                dbCon.ExecuteSql("delete  from question_knowledgepoint");
                dbCon.ExecuteSql("delete  from answer");
                dbCon.ExecuteSql("delete  from questionbody");
                dbCon.ExecuteSql("delete  from HistoryMessage");
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
